﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FanPages.Server.Services.Contracts;
using FanPages.Server.Services;
using FanPages.Server.Services.Contracts.Dto;
using FanPages.Common;
using FanPages.Client.Core.Transformers;
using FanPages.Model;
using FanPages.Client.Gui.Desktop.Contracts;

namespace FanPages.Client.Gui.Desktop.Controllers
{
    public class SearchController : ISearchController
    {
        ISearchService searchSvc = new SearchService();
        IFanItemService fanItemSvc = new FanItemService();

        public void SaveSearch(Model.SearchResult searchResult)
        {
            throw new NotImplementedException();
        }


        public List<Model.FanItem> GetAllFanItems()
        {
            ITransformer<FanItem, FanItemDto> transformer = new FanItemTransformer();
            var items = new List<FanItem>();
            fanItemSvc.GetAll().ForEach(x => { items.Add(transformer.ToClient(x)); });
            return items;
        }
    }
}
